package com.example.boot;

import com.example.client.RPCConsumer;
import com.example.quartz.QuartzMain;
import com.example.service.UserService;
import org.quartz.SchedulerException;

/**
 * @author lbq
 * @version 1.0
 * @date 2021/2/4 21:57
 */
public class ConsumerBoot {
    public static void main(String[] args) throws Exception {
        RPCConsumer rpcConsumer = new RPCConsumer();
        UserService service = (UserService) rpcConsumer.createProxy(UserService.class);
        QuartzMain.start("0/10 * * * * ?");
        while (true) {
            String result = null;
            try {
                result = service.sayHello("zhangsan");
            } catch (Exception e) {
                e.printStackTrace();
            }
            System.out.println(result);
            Thread.sleep(2000);
        }
    }
}
